package com.xcity.game.common;

public enum Currency {
	UNKNOWN(-1, ""),
	GOLD(1, "现金"),
	STONE(2, "钻石"),
	STRENGTH(3, "体力"),
	HONOR(4, "荣誉"), // 竞技场货币
	JOY_BEANS(5, "欢乐豆"), // 竞技场货币
	PEAK_COIN(6, "巅峰币"), // 爬塔副本产出
	GUILD_SCORE(7, "商会积分"), // 公会积分
	;
	
	public final byte code;
	public final String name;
	
	Currency(int code, String name) {
		this.code = (byte) code;
		this.name = name;
	}
	
	public static Currency forCode(int code) {
		if (code == 1) return GOLD;
		if (code == 2) return STONE;
		if (code == 3) return STRENGTH;
		if (code == 4) return HONOR;
		if (code == 5) return JOY_BEANS;
		if (code == 6) return PEAK_COIN;
		if (code == 7) return GUILD_SCORE;
		return UNKNOWN;
	}
	
}
